package com.cby.jetpack.sample.appstartup.init;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.List;

/**
 * Description:SDKOne
 *
 * @author 陈宝阳
 * @create 2020/6/29 16:10
 */
public class SDKOne {

  private static final String TAG = "SDKOne";

  private Context context;

  private List<String> datas = new ArrayList<>();

  private SDKOne() {}

  public static SDKOne getInstance() {
    return SingleTon.sINSTANCE;
  }

  private static class SingleTon{
    static final SDKOne sINSTANCE = new SDKOne();
  }

  public void init(Context context) {
    this.context = context.getApplicationContext();
    Log.i(TAG,"SDKOne----"+context.getPackageName());
    Toast.makeText(context, TAG+"-init", Toast.LENGTH_SHORT).show();
    initDatas();
  }

  private void initDatas() {
    datas.add("测试数据一");
    datas.add("测试数据一一");
    datas.add("测试数据一一一");
  }

  public void print() {
    Log.i(TAG,"SDKOne----"+context.getPackageName());
  }

  public List<String> getDatas(){
    return datas;
  }
}
